package cn.itcast.service;

import cn.itcast.mapper.UserMapper;
import cn.itcast.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Random;

@Service
public class UserService {
    @Autowired
    private UserMapper userMapper;

    public User queryUserById(Long id) throws InterruptedException {
        // Thread.sleep(new Random().nextInt(2000));
        // Thread.sleep((long) Math.random()*2000+1);
        return userMapper.selectByPrimaryKey(id);
    }
}
